package com.master;

import static com.util.Vessel.*;

public class LoginCrm {
    public void Start(){
        boolean isNext = false;
        do {
            System.out.println("请输入你的选择:");
            System.out.println("1.登录  2.注册  3.退出系统");
            int choice = scanner.nextInt();
            switch(choice){
                case 1:
                    int succeed = loginSerImpl.signInService();
                    if(succeed > 0){
                        System.out.println("请选择餐桌号:");
                        int tId = scanner.nextInt();
                        homeCrm.home(succeed,tId);
                    } else if (succeed == 0) {
                        managerCrm.manOperate();
                    }else {
                        System.out.println("账号或密码错误请重试!");
                    }
                    break;
                case 2:
                    loginSerImpl.signUpService();
                    break;
                default:
                    System.exit(0);
            }
            System.out.println("是否去登录注册界面？  1.是    2.退出");
            int next = scanner.nextInt();
            isNext = (next==1);
        }while (isNext);
    }
}
